<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html lang="zh">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>出库单打印</title>
<style media="print">
    @page {
      size: portrait;  /* auto is the initial value */
      margin: 5mm 0mm; /* this affects the margin in the printer settings */
    }
</style>
<style>
* {
	font-size: 14px;
	font-family: 'SimHei','SimSun';
}

body {
	width: 100%;
	margin: 0;
	padding: 0;
}

.wrap {
	padding: 0px 50px 0 50px;
}

.title {
	text-align: center;
	font-size: 1.8em;
	text-align: center;
	margin: 18px 0 8px 0;
}

/* h3 {
	font-size: 1.8em;
	text-align: center;
	margin: 30px 0 8px 0;
} */

table th, table td {
	vertical-align: middle;
}

.form-header, .form-bottom, .vacc-bottom {
	width: 100%;
	margin: 0 auto;
}

.form-bottom, .vacc-bottom {
	margin-bottom: 20px;
}

.form-bottom tr td {
	line-height: 25px;
}

.form-header td {
	width: 50%;
}

.vacc-info, .tran-tool {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	text-align: center;
	margin-bottom: 20px;
}

.vacc-info th, .tran-tool th {
	font-weight: normal;
	/* font-size: 1.2em; */
	padding: 4px;
}

.tran-tool th {
	text-align: left;
}

.vacc-info td, .tran-tool td {
	font-size: 0.8em;
	padding: 4px;
}

.vacc-info-height td, .tran-tool td {
	height: 30px;
}

.underline, .underline2, .underline3, .underline4 {
	border-bottom: thin solid #000;
	position: relative;
}

.underline {
	padding: 0 10px;
}

.underline2 {
	padding: 0 20px;
}

.underline3 {
	padding: 0 40px;
}

.underline4 {
	/* padding: 0 40px; */
	padding: 0 60px;
}

th span {
	bottom: -1px;
}

td span {
	margin-right: 4px;
	line-height: 26px;
	bottom: -2px;
}

.mr10 {
	margin-right: 10px;
}

.w30 {
	width: 6%;
	min-width: 6%;
}

.w50 {
	width: 8%;
	min-width: 8%;
}

.w70 {
	width: 10%;
	min-width: 10%;
}
</style>
</head>
<body>
	<div class="wrap">
		<p class = "title">${fns:getUser().office.name }&nbsp;疫苗运输记录表</p>
		<table class="form-header">
			<tr>
				<td style="width: 50%;">出库日期：<fmt:formatDate value="${bsVaccineOrder.outboundDate}" pattern="yyyy年MM月dd日"/> </td>
				<td style="width: 50%;">出库单号:${bsVaccineOrder.orderNo }</td>
			</tr>
			<tr>
				<td>疫苗运输工具：<span class="underline3">
					<c:if test="${bsVaccineOrder.transportation eq '3'}">
						${bsVaccineOrder.otherTransportation }
					</c:if>
					<c:if test="${bsVaccineOrder.transportation != '3'}">
						${fns:getDictLabel(bsVaccineOrder.transportation,'bs_order_transportation','')}
					</c:if>
				</span></td>
				<td >疫苗冷藏工具：<span class="underline3">
					<c:if test="${bsVaccineOrder.refrigeratetype eq '3' }">
						${bsVaccineOrder.otherRefrigeratetype }
					</c:if>
					<c:if test="${bsVaccineOrder.refrigeratetype != '3'}">
						${fns:getDictLabel(bsVaccineOrder.refrigeratetype,'bs_order_refrigeratetype','')}
					</c:if>
				</span></td>
			</tr>
			<c:if test="${not empty bsVaccineOrder.remarks}">
				<tr>
					<td>备注信息： ${bsVaccineOrder.remarks }
					</td>
				</tr>
			</c:if>
		</table>
		<p style = "margin: 2px;">运输疫苗情况：</p>
		<c:if test="${not empty list}">
			<table border="1" class="vacc-info vacc-info-height">
				<tr>
					<th class="w30">序</th>
					<th class="w70">名称</th>
					<th class="w50">生产企业</th>
					<th class="w50">规格</th>
					<th class="w50">批号</th>
					<th class="w50">有效期</th>
					<th class="w30">数量</th>
					<c:if test="${bsVaccineOrder.cType eq 2}">
						<th class="w30">单价</th>
						<th class="w30">冷链费</th>
					    <th class="w50">小计</th>
					</c:if>
				</tr>
				<c:forEach items="${list}" var="li">
					<tr>
						<td>${li.no eq 0?'':li.no}</td>
						<td>${li.bsVaccineBatchno.vaccineName }</td>
						<td>${li.bsVaccineBatchno.companyName }</td>
						<c:choose>
							<c:when test="${li.bsVaccineBatchno.batchType eq 2 }">
								<td>${li.bsVaccineBatchno.spec}</td>
							</c:when>
							<c:when test="${li.bsVaccineBatchno.batchType eq 1 }">
								<td>
                                    ${li.bsVaccineBatchno.dose},${li.bsVaccineBatchno.doseType}<br>
                                    ${li.bsVaccineBatchno.spec},${li.bsVaccineBatchno.containerType}
								</td>
							</c:when>
							<c:otherwise>
								<td></td>
							</c:otherwise>
						</c:choose>
						<td>
							${li.bsVaccineBatchno.batchno}
							<c:if test="${not empty li.bsVaccineBatchno.secondBatchno}">
						        -${li.bsVaccineBatchno.secondBatchno}
						    </c:if>
						</td>
						<td><fmt:formatDate value="${li.bsVaccineBatchno.outBoundDate}" pattern="yyyy/MM/dd"/></td>
						<td>${li.vaccNum }</td>
						<c:if test="${bsVaccineOrder.cType eq 2}">
							<td>${li.orignprice eq 0?'':'￥' }${li.orignprice eq 0?'':li.orignprice}</td>
							<td>
								<c:if test="${not empty li.vaccNum }">
							        ${li.coldprice}
						        </c:if>
						        <c:if test="${empty li.vaccNum }">
						        </c:if>
					        </td>
							<td><fmt:formatNumber value="${li.sellprice eq 0?'':li.sellprice*li.vaccNum}" type="currency" pattern="￥.0#"/></td>
						</c:if>
					</tr>
				</c:forEach>
				<tr>
					<td colspan="6" class="text-right">合计</td>
				    <c:if test="${bsVaccineOrder.cType eq 2}">
						<td>${count2 }</td>
						<td colspan="2">——</td>
						<td>￥${amount2 }</td>
				    </c:if>
				    <c:if test="${bsVaccineOrder.cType eq 1}">
						<td>${count}</td>
				    </c:if>
				</tr>
			</table>
		</c:if>

		<p  style = "margin: 2px;">运输温度记录:</p>
		
		<table border="1" class="vacc-info">
			<tr>
				<th>项目</th>
				<th>日期/时间</th>
				<th>疫苗储存温度</th>
				<th>环境温度</th>
			</tr>
			<tr>
				<td>启运</td>
				<td>&emsp;&emsp;&emsp;年&emsp;&emsp;月&emsp;&emsp;日&emsp;&emsp;时&emsp;&emsp;分</td>
				<td>&emsp;&emsp;&emsp;℃</td>
				<td>&emsp;&emsp;&emsp;℃</td>
			</tr>
			<tr>
				<td>途中</td>
				<td>&emsp;&emsp;&emsp;年&emsp;&emsp;月&emsp;&emsp;日&emsp;&emsp;时&emsp;&emsp;分</td>
				<td>&emsp;&emsp;&emsp;℃</td>
				<td>&emsp;&emsp;&emsp;℃</td>
			</tr>
			<tr>
				<td>到达</td>
				<td>&emsp;&emsp;&emsp;年&emsp;&emsp;月&emsp;&emsp;日&emsp;&emsp;时&emsp;&emsp;分</td>
				<td>&emsp;&emsp;&emsp;℃</td>
				<td>&emsp;&emsp;&emsp;℃</td>
			</tr>
		</table>
		
		<table class="form-bottom">
			<tr>
				<td  colspan="2">启运至到达行驶里程数：<span class="underline4"></span>千米</td>
			</tr>
			<tr>
				<td style="width: 65%;">供疫苗单位：<span class="underline3">${bsVaccineOrder.supplyorgName}</span></td>
				<td style="width: 35%;">供疫苗人签名：<span class="underline3"></span></td>
			</tr>
			<tr>
				<td style="width: 65%;">收疫苗单位：<span class="underline3">${bsVaccineOrder.receiveorgName}</span></td>
				<td style="width: 35%;">收疫苗人签名：<span class="underline3"></span></td>
			</tr>
		</table>
		
		<p style="margin: 2px 0;">
			填写说明：①本表供疫苗配送企业、疾病预防控制机构、接种单位疫苗运输时填写；
			②出入库单号为单位编码+年月日+2位流水号；
			③运输超过6小时需记录途中温度，间隔不超过6小时；
			④疫苗类别：一类疫苗/二类疫苗
		</p>
	</div>
</body>
<script>
		window.print(); 
		setTimeout("top.opener=null;window.close()",1);
</script>
</html>